package com.crawler.demo.common;

import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.crawler.demo.config.AppConfig;
import com.crawler.demo.config.JacksonObjectMapper;
import com.crawler.waf.testconfig.AbstractSpringJunit4Config;
import com.fasterxml.jackson.databind.ObjectMapper;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class })
public class UnitTestBase  extends AbstractSpringJunit4Config{
	@Override
	protected void initUserId() {
		this.setUserId("8");
		
	}
	
	@Override
	public void setUp() {

	}

	protected void print(Object object){
		System.out.println("==============================================================================================");
		try{
			ObjectMapper objectMapper = new JacksonObjectMapper();
			System.out.println(objectMapper.writeValueAsString(object));
        }
        catch(Exception ex){
            System.out.println("无法转为json格式：" + object);
        }
		System.out.println("==============================================================================================");
	}


}
